<include file="public/head" />
</head>
<body>

<div class="am-modal am-modal-alert" tabindex="-1" id="fq_alert">
  <div class="am-modal-dialog">
    <div class="am-modal-hd" id="fq_alert_title"></div>
    <div class="am-modal-bd" id="fq_alert_info">
    </div>
    <div class="am-modal-footer">
      <span class="am-modal-btn">确定</span>
    </div>
  </div>
</div>

<div class="am-modal am-modal-confirm" tabindex="-1" id="fq_confirm">
  <div class="am-modal-dialog">
    <div class="am-modal-hd" id="fq_confirm_title"></div>
    <div class="am-modal-bd" id="fq_confirm_info"></div>
    <div class="am-modal-footer">
      <span class="am-modal-btn" data-am-modal-confirm="">确定</span>
    </div>
  </div>
</div>

<link rel="stylesheet" type="text/css" href="__STATIC__/itaoke/mobile/css/personal.css">
<link rel="stylesheet" type="text/css" href="//at.alicdn.com/t/font_1474962031_5384622.css">
<style>
    .am-classification a {
        height: 48px;
    }

    .iconfont {
        font-size:20px!important;
        color:#8f8f8f;
    }
</style>

<div class="move am-text-sm">
    <header style="position:relative;z-index:999;background:#F54D23;">
    <a href="{:U('Index/index')}" style="position:absolute;top:2px;color:#fff;width:45px;height:100%;padding-left:10px;font-size:25px;" class="am-inline-block am-text-middle am-icon-angle-left"><!-- <img src="/Public/assets/mobile/images/left.png" />--></a><div class="am-per-center am-text-center am-padding-vertical-sm" style="color:#fff;font-size:16px;">个人中心</div>
</header>

    <div class="am-head fq-background-white am-padding-vertical-lg am-text-center am-vertical-align ">
        <div class="am-round am-vertical-align-middle am-text-sm">
            <img src="{:avatar($info['id'], 200)}" class="am-round">
        </div>
        <br>
        <php>$username= $info['wxnickname']!='' ? $info['wxnickname'] : $info['username']</php>
        <span class="am-vertical-align-middle am-margin-top-xs am-text-sm">{$username}</span><br>
         <span class="am-text-xs" style="color:#F54D23;">（UID:{$info.id}）</span>
    </div>
    <ul class="am-avg-sm-3 am-reveal fq-background-white am-padding-bottom">
        <li class="am-text-center">
            <a href="{:U('Sign/index')}" class="am-block">
               <img src="__STATIC__/itaoke/mobile/images/personal/register.png" class="am-block am-center am-text-center">			   
               <!-- <i class="iconfont am-block am-center am-text-center icon-calendar" style="color:#f54d23"></i>    -->
                <span class="am-vertical-align-middle am-padding-top-xs am-text-sm">连续签到<span>{$qday}</span>天</span>
            </a>
        </li>
        <li class="am-text-center">
            <a class="am-block">
                <img src="__STATIC__/itaoke/mobile/images/personal/<if condition="$info.gender eq 1">male<else/>female</if>.png" class="am-block am-center am-text-center">
                <span class="am-vertical-align-middle am-padding-top-xs am-text-sm"><if condition="$info.gender eq 1">男<else/>女</if> </span>
            </a>
        </li>
        <li class="am-text-center">
            <a href="{:U('User/mingxi')}">
                <img src="__STATIC__/itaoke/mobile/images/personal/wallet.png " class="am-block am-center am-text-center">
                <span class="am-vertical-align-middle am-padding-top-xs am-text-sm">{$info.score}</span>
            </a>
        </li>
    </ul>
    <div class="column">
        <div class="am-classification am-margin-top-sm fq-background-white">
            <a class="am-margin-horizontal-sm am-integration am-vertical-align am-block">
                 <i class="am-vertical-align-middle am-inline-block am-margin-right-sm am-text-sm icon-unpaidorder iconfont"></i>
                <span class="am-text-middle am-text-sm am-inline-block">赚取积分</span>
				<div class="am-fr am-vertical-align am-text-sm" style="height:100%; position:relative;right:2px ">
                <span class="am-icon-sm am-intergr-icon am-icon-angle-right am-text-sm" id="change_icon" style="position:relative;top:1px"></span>
				</div>
            </a>
        </div>

        <div class="integral-details fq-background-white">
            <ul class="am-avg-sm-3 am-margin-horizontal-sm am-text-center">
                <li>
                    <a class="am-center am-text-center am-block am-margin-top" href="{:U('Sign/index')}">
                        <i class=" am-text-center am-block icon-raxiconqianshu iconfont" style="margin-top:20px;"></i>
                    </a>
                    <span class="am-margin-top-xs am-block">每日签到</span>
                </li>
                <li>
                    <a class="am-center am-vertical-align am-block am-margin-top" href="{:U('Invitation/index')}">
                        <i class="am-vertical-align-middle am-inline-block icon-yaoqinghaoyou iconfont"></i>
                    </a>
                    <span class="am-margin-top-xs am-block">邀请好友</span>
                </li>
                <!--  <li>
                    <a class="am-center am-vertical-align am-block am-margin-top">
                        <img src="/Public/assets/mobile/images/personal/smash.png" class="am-vertical-align-middle am-text-sm" /></a>
                    <span class="am-margin-top-xs am-text-center am-block">砸金蛋</span>
                </li> -->
                <!-- <li>
                        <a class="am-center am-block am-margin-top" href="{:U('Invitation/index')}">
                           <img src="/Public/assets/mobile/images/personal/prize-unact.png" class="am-vertical-align-middle am-text-sm" />
                            <i class=" am-text-center am-block icon-unie6d32 iconfont" style="margin-top:20px;"></i>
                        </a>		
                        <span class="am-margin-top-xs am-text-center am-block">抽奖</span>
                    </li> -->              <!--  <li>
                    <a class="am-center am-margin-top am-vertical-align  am-block">
                        <img src="/Public/assets/mobile/images/personal/scratch.png" class="am-vertical-align-middle am-text-sm" /></a>
                    <span class="am-margin-top-xs am-block">刮刮卡</span>
                </li>
                
                <li>
                    <a class="am-center am-margin-top am-vertical-align am-block">
                        <img src="/Public/assets/mobile/images/personal/order.png" class="am-vertical-align-middle am-text-sm" /></a>
                    <span class="am-margin-top-xs am-text-center am-block">订单换积分</span>
                </li> -->

                <li>
                    <a class="am-center am-block am-margin-top" href="{:U('Share/index')}">
                         <i class="am-text-center am-block icon-imagepicture iconfont" style="margin-top:20px;"></i>
						</a>
                    <span class="am-margin-top-xs am-text-center am-block">晒单赚积分</span>
                </li>

               <!--  <li>
                   <a class="am-center am-margin-top am-vertical-align am-block">
                       <img src="/Public/assets/mobile/images/personal/questionnaire.png" class="am-vertical-align-middle am-text-sm" /></a>
                   <span class="am-margin-top-xs am-text-center am-block">问卷调查</span>
               </li> -->

            </ul>
        </div>

        <div class="am-classification fq-background-white">
            <a class="am-margin-horizontal-sm am-vertical-align am-block" href="{:U('Gift/index')}">
             <!--   <img src="/Public/assets/mobile/images/personal/integr-mall.png" class="am-vertical-align-middle am-margin-right-sm am-text-sm" />-->
                  <i class="am-vertical-align-middle am-inline-block am-margin-right-sm am-text-sm icon-shoppingcart2 iconfont"></i>
                <span class="am-text-middle am-text-sm am-inline-block">积分商城</span>

            </a>
        </div>
       <div class="am-classification fq-background-white">
           <a class="am-margin-horizontal-sm am-vertical-align am-block" href="{:U('User/maddress')}">
              <!-- <img src="/Public/assets/mobile/images/personal/icon-address.png" class="am-vertical-align-middle am-margin-right-sm am-text-sm" />-->
                <i class="am-vertical-align-middle am-inline-block am-margin-right-sm am-text-sm icon-loaction iconfont"></i>
               <span class="am-text-middle am-text-sm am-inline-block">地址管理</span>
           </a>
       </div>
	   
	   <div class="am-classification fq-background-white">
           <a class="am-margin-horizontal-sm am-vertical-align am-block" href="{:U('User/gift')}">
            <!--   <img src="/Public/assets/mobile/images/personal/icon-record.png" class="am-vertical-align-middle am-margin-right-sm am-text-sm" />-->
                 <i class="am-vertical-align-middle am-inline-block am-margin-right-sm am-text-sm icon-detail iconfont"></i>
               <span class="am-text-middle am-text-sm am-inline-block">兑换记录</span>
           </a>
       </div>
	   
        <div class="am-classification fq-background-white">
            <a class="am-margin-horizontal-sm am-vertical-align am-margin-top-sm  am-block" href="{:U('User/msg')}">
                 <i class="am-vertical-align-middle am-inline-block am-margin-right-sm am-text-sm icon-help iconfont"></i>
                <span class="am-text-middle am-text-sm am-inline-block">建议反馈</span>
            </a>
        </div>

<!--        <div class="am-classification fq-background-white" style="position:relative;">
            <a class="am-margin-horizontal-sm am-vertical-align am-block" href="/user/user_feedback" id="read-feedback">

                <i class="am-vertical-align-middle am-inline-block am-margin-right-sm am-text-sm icon-endorse iconfont"></i>
				<span class="am-text-middle am-text-sm am-inline-block">建议反馈</span>
            </a>
        </div>-->

        <div class="am-classification fq-background-white">
            <a class="am-margin-horizontal-sm am-service am-vertical-align am-block">
              <!--  <img src="/Public/assets/mobile/images/personal/service.png" class="am-vertical-align-middle am-margin-right-sm am-text-sm" />		-->

                 <i class="am-vertical-align-middle am-inline-block am-margin-right-sm am-text-sm icon-icon23 iconfont"></i>

                <span class="am-text-middle am-text-sm am-inline-block">联系客服</span>
				
					<div class="am-fr am-vertical-align am-text-sm" style="height:100%; position:relative;right:2px">
                <span class="am-text-sm am-icon-sm am-intergr-icon am-icon-angle-right" id="service_icon" style="position:relative;top:1px"></span>
				</div>
            </a>
        </div>
        <div class="service am-text-center am-padding-top-sm" style="background: white; display: none;">
									<div class="am-margin-bottom-xs am-text-center am-text-default">客服微信号(扫我哦)</div><img src="{:C('itk_site_wxkefu')}" class="am-center">
					<div class="am-margin-top-xs am-text-default">长按二维码加客服好友联系</div>
        </div>

        <div class="am-margin-horizontal am-padding-vertical-sm">
            <label class="am-margin-horizontal-xs">
                <input type="checkbox" style="width:16px; height:16px" id="tplAttention" <if condition="$info['ison'] eq 1">checked=""</if>>
                <span class="am-padding-left-xs am-text-xs" style="position:relative; top:-2.6px">订阅最新的优惠秒杀信息</span>
            </label>
        </div>

    </div>

</div>
<include file="public/foot" />
       <div class="am-modal am-modal-no-btn" tabindex="-1" id="qrcode_large">
            <div class="am-modal-dialog">
                <div class="am-modal-hd">
                    <span class="am-text-sm">↓点击二维码放大后长按关注↓</span>
                    <a href="javascript: void(0)" class="am-close" style="top: -5px; right: 0px;" data-am-modal-close>&times;</a>
                </div>
                <div class="am-g">
                    <figure data-am-widget="figure" class="am am-figure" data-am-figure="{pureview:'true'}">
                    <div class="am-u-sm-6">
                    <img id="qrcode_img_large" src="{:C('itk_site_weixin')}" data-rel="{:C('itk_site_weixin')}" style="width:100%;">
                    <span class="am-text-xs am-text-danger" style="top: -2px;position: relative;">关注公众号</span>
                </div>
                <div class="am-u-sm-6">
                        <img id="qrcode_img_large" src="{:C('itk_site_wxkefu')}" data-rel="{:C('itk_site_wxkefu')}" style="width:100%;">
                        <span class="am-text-xs am-text-danger" style="top: -2px;position: relative;">客服微信</span>
                    </div>
                </figure>
            </div>
        </div>
		</div>

<div class="am-modal am-modal-confirm" tabindex="-1" id="fq_true_confirm">
    <div class="am-modal-dialog">
        <div class="am-modal-hd" id="fq_true_confirm_title"></div>
        <div class="am-modal-bd" id="fq_true_confirm_info"></div>
        <div class="am-modal-footer">
            <span class="am-modal-btn" data-am-modal-confirm="">确定</span>
            <span class="am-modal-btn" data-am-modal-cancel="">取消</span>
        </div>
    </div>
</div>

<script>
    function acceptChange(uid, status) {
        $.ajax({
            type: 'post',
            data: { "uid": uid, "status": status },
            dataType: 'json',
            url: '{:U('User/accept')}',
            success: function (res) {
                if (status == 1) {
                    if (res.status == 1) {
                        $('#fq_alert_info').html('恭喜您订阅成功！<br />我们会精挑细选最优惠的商品推荐给您！');
                        $('#fq_alert').modal();
                        $('#tplAttention').prop('checked', true);
                    } else if (res.status == 0) {
                        $('#fq_alert_info').html('系统繁忙，请稍后再试');
                        $('#fq_alert').modal();
                        $('#tplAttention').prop('checked', false);
                    } else {
                        $('#fq_alert_info').text(res.data.info);
                        $('#fq_alert').modal();
                        $('#tplAttention').prop('checked', false);
                    }
                } else {
                    if (res.status == 1) {
                        $('#fq_alert_info').html('取消订阅成功！<br />如还想捡便宜，可再次订阅！');
                        $('#fq_alert').modal();
                        $('#tplAttention').prop('checked', false);
                    } else if (res.status == 0) {
                        $('#fq_alert_info').html('系统繁忙，请稍后再试');
                        $('#fq_alert').modal();
                        $('#tplAttention').prop('checked', true);
                    } else {
                        $('#fq_alert_info').text(res.data.info);
                        $('#fq_alert').modal();
                        $('#tplAttention').prop('checked', true);
                    }

                }
            }
        });
    }
    $(document).ready(function () {
        //积分详情显隐
        $(".am-integration").click(function () {
            $(".integral-details ").slideToggle("slow", function () {
                if ($(".integral-details").is(":hidden")) {
                    $("#change_icon").removeClass('am-icon-angle-down').addClass('am-icon-angle-right');
                } else {
                    $("#change_icon").removeClass('am-icon-angle-right').addClass('am-icon-angle-down');
                }

            });
        });
        //联系客服内容打开关闭
        $(".am-service").click(function () {
            $(".service").slideToggle("slow", function () {
                if ($(".service").is(":hidden")) {
                    $("#service_icon").removeClass('am-icon-angle-down').addClass('am-icon-angle-right');
                } else {
                    $("#service_icon").removeClass('am-icon-angle-right').addClass('am-icon-angle-down');
                }
            });
        });
        //阅读新的反馈时，将带有新消息标志的图片换成默认图片
        $("#read-feedback").on('click', function () {
            $("#change-img").attr('src', '__STATIC__/itaoke/mobile/images/personal/feedback.png');
        });

        //订阅状态
        $('#tplAttention').click(function () {
            var is_accept = $(this).prop('checked');
            var uid = $(this).data('uid');
            if (is_accept == true) {
                $(this).prop('checked', false);
                acceptChange(uid, 1);
            } else {
                $(this).prop('checked', true);
                $('#fq_true_confirm_info').html('您将会就此错过捡便宜的最佳时机哦！<br />点击《确定》不想捡便宜<br />点击《取消》继续捡便宜');
                $('#fq_true_confirm').modal({
                    relatedTarget: this,
                    onConfirm: function () {
                        acceptChange(uid, 0);
                    }
                });
            }
        })
    });
    $('.ckeck_open').click(function () {
        $('#fq_alert_info').text("很抱歉，暂未开启签到功能！");
        $('#fq_alert').modal();
    });
</script>
</body>
</html>